import { Collapse, CollapsePanel } from 'ant-design-vue'
import { defineComponent, type PropType } from 'vue'
import type { JsonSchema, Slots } from '../types'

export default defineComponent({
  inheritAttrs: true,
  props: {
    schema: {
      type: Object as PropType<JsonSchema>,
      default: () => ({})
    },
    slots: {
      type: Object as PropType<Slots>,
      default: () => undefined
    }
  },
  setup(props) {
    return () => {
      return (
        <div class="collapse-field_wrapper">
          <Collapse>
            <CollapsePanel key="1" {...props.schema.props}>
              <p>{{ props }}</p>
            </CollapsePanel>
          </Collapse>
        </div>
      )
    }
  }
})
